package operation;

import Book.Book;
import Book.BookList;

import java.util.Scanner;

public class AddOperation implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println();
        System.out.println("*************************");

        System.out.println("开始书籍信息采集！");
        System.out.println();

        Scanner scanner=new Scanner(System.in);

        System.out.println("请输入书名：");
        String bname=scanner.nextLine();

        System.out.println("请输入书籍的作者：");
        String aname=scanner.nextLine();

        System.out.println("请输入书籍的价格：");
        double bprice=scanner.nextDouble();

        Book book=new Book(bname,aname,bprice);

        bookList.setBooks(book);
        System.out.println("书籍添加成功！");
        System.out.println();
        System.out.println("*************************");

    }
}
